<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // const obj = new Object(); //object
      // const user = {name:'jack',age:20}
      const user = new Map(); // 映射
      user.set("name", "jack"); // user.name
      user.set("age", 20);
      user.clear(); // delete all
      console.log("size()", user.size);
      console.log('delete("age")', user.delete("age")); // delete
      console.log(user.get("name")); // user.name
      console.log(user.get("age"));
      console.log('has("age")', user.has("age")); //in
    </script>
  </body>
</html>
